# -*- coding: utf-8 -*-#
#-------------------------------------------------------------------------------
# 建立者:        潘炎珍  
# Name:         test05
# Description:
# Author:       98745
# Date:         2019/3/16
#-------------------------------------------------------------------------------

class Animal:
    def __init__(self):
        print('Animal 类')
        self.name = 'tedy'

    def eat(self):
        print('我想吃东西')



class Dog(Animal):
    def __init__(self):
        super().__init__()
        # self.name = 'mingming'
        super().eat()
        print(self.name)
        print('Dog 类')

    def walk(self):
        print('我想散步')

    def eat(self):
        super().eat()
        print('狗爱吃骨头')


class Man:
    def dea(self):
        return '我在类里'

    def do_work(self):
        print('我正在上课')

def default():
    return 'default'

def do_work():
    print('要去工作了')


if __name__ =='__main__':
    animal=Animal()
    animal.eat()

    print('----------')
    dog=Dog()
    dog.eat()
    dog.walk()

    print('-----------')
    print(issubclass(Dog,Animal))

    print('-------------')
    print(issubclass(Man,Animal))
    print(dog.name)
    # m=Man()
    # print(hasattr(m,'name'))
    # m.name='pan'
    # print(hasattr(m, 'name'))
    #
    # print('-----------')
    # de=getattr(m,'deab',default)
    # print(de())
    #
    # print('-------------')
    # setattr(m,'name','pan')
    # print(m.name)
    #
    # print('================')
    # setattr(m,'name','yan')
    # print(m.name)
    #
    # print('==============')
    # m.do_work()
    # setattr(m,'do_work',do_work)
    # m.do_work()